﻿<UserControl x:Class="Rio.Framework.Pages.Workflow.WorkflowToolBar"
             x:Name="workflowToolBar"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:filter="clr-namespace:Rio.Framework.Pages.Workflow.Filters"
             xmlns:conv="clr-namespace:Rio.Framework.Pages.AppCode.Helpers.Converter"
             mc:Ignorable="d">
    <UserControl.Resources>
        <conv:IntToVisibilityConverter x:Key="IntToVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <telerik:RadToolBar GripVisibility="Collapsed">
            <Image Margin="5,0,0,0"
                   Source="/Rio.Framework.Pages;component/Assets/Images/filter_blue.png"
                   VerticalAlignment="Center"
                   Width="14" />
            <TextBlock Name="filterByLabel"
                       Text="Filtrer par :"
                       FontStyle="Italic"
                       VerticalAlignment="Center"
                       Margin="5,0,0,0" />
            <filter:ComboFilterState Margin="2,1,0,1"
                                     Items="{Binding Filters, ElementName=workflowToolBar, Mode=TwoWay}"
                                     MinWidth="150"
                                     Height="23"
                                     SelectedFilter="{Binding SelectedFilter, ElementName=workflowToolBar, Mode=TwoWay}" />
            <telerik:RadToolBarSeparator Margin="2" />
            <telerik:ItemsControl ItemsSource="{Binding AvailableActions, ElementName=workflowToolBar, Mode=TwoWay}"
                                  Margin="5,0,0,0"
                                  VerticalAlignment="Center"
                                  Visibility="{Binding AvailableActions, Converter={StaticResource IntToVisibilityConverter}, ElementName=workflowToolBar, Mode=TwoWay}">
                <telerik:ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </telerik:ItemsControl.ItemsPanel>
            </telerik:ItemsControl>
        </telerik:RadToolBar>
    </Grid>
</UserControl>